package com.runen.infinitemovement.tool;

import com.amap.api.location.AMapLocation;
import com.amap.api.maps.AMapUtils;
import com.amap.api.maps.model.LatLng;

import org.greenrobot.eventbus.Subscribe;

import java.lang.reflect.Method;

/**
 * Create by LiaoDuanHong
 * Create on 2020/08/26 15:39
 */
public class Utils {
    /**
     * 判断类中是否包含EventBus的注解
     *
     * @param classz
     * @return
     */
    public static boolean hasEventBus(Class<?> classz) {
        Method[] methods = classz.getDeclaredMethods();
        for (Method method : methods) {
            if (method.isAnnotationPresent(Subscribe.class)) {
                return true;
            }
        }
        return false;
    }

}
